package com.yjc.rabbitmq.springboot_rabbitmq.consumer;

import com.rabbitmq.client.Channel;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @author shkstart
 * @create 2022-08-02 17:40
 */
@Slf4j
@Component
public class DeadLetterQueueConsumer {

    @RabbitListener(queues = "QD")
    public void reveiveD(Message message, Channel channel) {
        String res = new String(message.getBody());
        log.info(res);
    }
}
